<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>WaitSemaphore</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">WaitSemaphore()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>WaitSemaphore</b></font>(Semaphore)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Decreases the internal count of the semaphore by one, blocking thread execution if the count would 
fall below zero. A blocked thread is resumed as soon as another thread calls <a href="signalsemaphore.html">SignalSemaphore()</a>. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>Semaphore</i></td>
<td width="90%"> 
 
The semaphore to wait for. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>备注</b></p><blockquote>



The semaphore count is limited to a signed <a href="../reference/variables.html">32-bit value</a>, so a maximum of 2147483647 
<a href="waitsemaphore.html">WaitSemaphore()</a> calls can be made without being balanced by <a href="signalsemaphore.html">SignalSemaphore()</a> 
calls in between. 
<br>
<br>
See <a href="createsemaphore.html">CreateSemaphore()</a> for a code example. 
 
</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=unlockmutex.html>UnlockMutex()</a> - <a href="index.html">Thread Index</a> - <a href="waitthread.html">WaitThread()</a> -&gt;<br><br>

</body></html>